package com.xingchi.tornado.basic;

/**
 * 通用状态码 返回 10000-20000 通用状态码
 *
 * @author xingchi
 * @date 2022/8/18 23:26
 * @modified xingchi
 */
public enum CommonCode implements BaseCode {

    /**
     * 成功状态码
     */
    SUCCESS(10000, "成功"),
    PARAM_CHECK_FAIL(10001, "参数校验异常"),
    FAIL(99999, "服务器正忙，请稍后重试或联系管理员~"),
    BUSINESS_ERROR(11000, "业务繁忙，请稍后重试或联系管理员~"),
    UNKNOWN(11002, "未知异常，请稍后重试或联系管理员~"),

    ;

    private final Integer code;
    private final String message;

    CommonCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
